import 'package:flutter/material.dart';
import 'package:flutter_demo/provider/active.dart';
import 'package:flutter_demo/utils/screen_size_fit.dart';
import 'package:provider/provider.dart';

class homeBanner extends StatefulWidget {
  @override
  _homeBannerState createState() => _homeBannerState();
}


class _homeBannerState extends State<homeBanner> {
  get activeDate => Provider.of<HomeProvider>(context).activeDate;

  @override

  Widget build(BuildContext context) {
    ScreenSizeFit(context);
    return Stack(
      children: [
        Container(
          child: Image.asset(
              'assets/images/banner.png',
              width: 750.w,
              height: 1240.w
          ),
        ),
        Positioned(
            top: 410.w,
            left: 140.w,
            child: Container(
              width: 470.w,
              height: 50.w,
              child: Center(
                child: Text(
                    '活动时间：$activeDate',
                    style: new TextStyle(
                      color: new Color(0xffffffff),
                      fontSize: 26.ssp,
                      fontWeight: FontWeight.bold,
                      decoration: TextDecoration.none,
                    )),
              ),
              decoration: BoxDecoration(
                  color: Color.fromRGBO(237, 107, 87, 1),
                  borderRadius: BorderRadius.circular(25)
              ),
            )),
      ],
    );
  }
}